﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Directory.Web
{
	public partial class Admin_ContributionRank : System.Web.UI.Page
	{
		protected int pageIndex;
		protected string pageKey = "page";
		protected int pageSize = WebSettings.GetInstance().UserViewPageSize;
		protected int totalRecords;


		protected void Page_Load(object sender, EventArgs e)
		{
			if (!int.TryParse(Request.QueryString[pageKey], out pageIndex))
			{
				pageIndex = 0;
			}

			if (!IsPostBack)
			{
				rptUsers.DataSource = ItemDataProxy.GetContributionRank(pageIndex, pageSize, out totalRecords);
				rptUsers.DataBind();

				this.PageBreak.PageIndex = pageIndex;
				this.PageBreak.PageKey = pageKey;
				this.PageBreak.PageSize = pageSize;
				this.PageBreak.TotalRecords = totalRecords;
				this.PageBreak.NavigatorUrl = Request.Url.AbsolutePath + "?";
			}
		}
	}
}